from ChessBoard import *
import time

#plays a game of chess, which it reads from a file.

chessboard = ChessBoard()
chessboard.resetBoard()

f = open('moves.txt', 'r')

moves = []
print "Loading moves..."

for line in f:
    moves.extend((line.rstrip()).split(" "))
print "Moves loaded"

i = 0
for move in moves:
    print "Move number: ", i
    i += 1
    chessboard.printBoard()
    print chessboard.addTextMove(move)
    time.sleep(0.1)

chessboard.printBoard()
chessboard.printBoardSingleRow()
